package top.zhangjianyong.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ： zhangjianyong
 * @date ： 2022/8/22 10:07 AM
 */
public class ArgsUtil {

    public static Map<String, String> convertMap(String[] args, String prefix) {
        Map<String, String> map = new HashMap<>();
        for (String a : args) {
            if (a.contains("=")) {
                String[] split = a.split("=");
                String key = split[0].replace(prefix, "");
                map.put(key, split[1]);
            }
        }
        return map;
    }
}
